
{extend name="public:common_edit"/}
{block name="css"}
<style>
    .form-control {
        max-width: 350px;
    }

    .tb-name {
        width: 238px;
    }
    .error{
        color: red;
        margin-top: 10px;
        display: none;
    }
    .select{
        margin-bottom: 10px;
    }
    .doctor{
        display: none;
    }
</style>
{/block}
{block name="main"}
<section class="content">
    <div class="container-fluid">
        <div class="pull-right">
            <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default"
               data-original-title="返回"><i class="fa fa-reply"></i></a>
            <a href="javascript:void(0);" class="btn btn-default"
               data-url="javascript:;"
               onclick="get_help(this)"><i class="fa fa-question-circle"></i> 帮助</a>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-list"></i> {$title}</h3>
            </div>
            <div class="panel-body">
                <!--表单数据-->
                <form action="" method="post" class="form-horizontal"
                      id="category_form">

                    <!--通用信息-->
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab_tongyong">
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td>封面图片:</td>
                                    <td>{:uploadHtml('img',$data.img,'single_img')}</td>
                                </tr>
                                <tr>
                                    <td>简介:</td>
                                    <td><input placeholder="简介" class="form-control" name="title" type="text" value="{$data.title}"></td>
                                </tr>
                                <!--<tr>-->
                                    <!--<td>排序:</td>-->
                                    <!--<td><input placeholder="排序" class="form-control" name="order" type="text" value="{$data.order}"></td>-->
                                <!--</tr>-->
                                <tr>
                                    <td>跳转类型:</td>
                                    <td>
                                        <select class="form-control" name="type">
                                            <option id="type1" value="1">跳转外链</option>
                                            <option id="type2" value="2">跳转文章详情</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td>链接地址(文章id):</td>
                                    <td><input placeholder="链接地址" class="form-control" name="url" type="text" value="{$data.url}"></td>
                                </tr>
                                <tr>
                                    <td>状态:</td>
                                    <td>
                                        <select class="form-control" name="status">
                                            <option id="status1" value="1"> 启用</option>
                                            <option id="status0" value="0">禁用</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td>分类:</td>
                                    <td>{:arr2select('cid',$result,'',$data['cid'],'cid','cate_name')}</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="pull-right">
                        <label class="control-label col-sm-2"></label>
                        <input type="hidden" name="id" value="{$data.bid}">
                        <input class="btn btn-primary submit" type="submit" value="保存">
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
{/block}
{block name="js"}
<script>
    $(function () {
        var type   = "{$data.type}";
        if(type != ''){
            $('#type'+type).attr('selected',true)
        }

        var status   = "{$data.status}";
        if(status != ''){
            $('#status'+status).attr('selected',true)
        }
    })

</script>



{/block}